// app.js
import './utils/utils.js'
import './utils/http.js'
App({
  globalData: {},
  //做token的判断
  onLaunch(){
    this.getToken()
  },
  getToken(){
//拿本地储存
 const token = wx.getStorageSync('token')
 const refreshToken = wx.getStorageSync('refreshToken')
 //把token挂再实例对象上
 this.token = token
 this.refreshToken = refreshToken
  },
  //保存token
  setToken(key,token){
    this[key]=token
    wx.setStorageSync(key, token)
  },
  setUsers(nickName,avatar){
    this.nickName =nickName
    this.avatar= avatar
  } 
})
